package org.dousb.douojbackendserviceclient.service;


import org.dousb.douojbackend.model.entity.Question;
import org.dousb.douojbackend.model.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 豆沙包
 * @description 针对表【question(题目)】的数据库操作Service
 * @createDate 2025-06-09 08:27:40
 */
@FeignClient(name = "douoj-backend-question-service", path = "/api/question/inner")
public interface QuestionFeignClient {

//            ● questionService.getByld(questionld)
//            ● questionSubmitService.getByld(questionSubmitld)
//            ● questionSubmitService.updateByld(questionSubmitUpdate)

    /**
     * 根据id获取题目
     *
     * @param questionId
     * @return
     */
    @GetMapping("/get/id")
    Question getQuestionById(@RequestParam("questionId") Long questionId);


    /**
     * 根据id获取题目提交
     *
     * @param questionSubmitId
     * @return
     */
    @GetMapping("/question_submit/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionId") Long questionSubmitId);

    /**
     * 更新题目提交
     *
     * @param questionSubmit
     * @return
     */
    @PostMapping("/question_submit/update")
    boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);
}
